home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS Toolkit
/
BBS Toolkit.iso
/
rbbs_pc
/
173amrg.zip
/
RSB5173A.MRG
< prev
next >
Wrap
Text File
|
1990-08-26
|
27KB
|
654 lines
* ------------[ BLED merge (c) Ken Goosens ]-------------
* Merge this against D:\172B\RBBSSUB5.BAS to produce RBBSSUB5.BAS
* D:\172B\RBBSSUB5.BAS: Date 2-10-1990 Size 86814 bytes
* ------------[ Created 08-26-1990 11:33:08 ]------------
* REPLACING old line(s) by new
' $linesize:132
* ------[ first line different ]------
' $title: 'RBBSSUB5.BAS 17.3A, Copyright 1986 - 90 by D. Thomas Mack' ' DA081003
' Copyright 1990 by D. Thomas Mack, all rights reserved.
' Name ...............: RBBSSUB5.BAS
' First Released .....: February 11, 1990
' Subsequent Releases.: August 26, 1990
' Copyright ..........: 1986 - 1990
' Purpose.............: The Remote Bulletin Board System for the IBM PC,
' RBBS-PC.BAS utilizes a lot of common subroutines. Those that do not
' require error trapping are incorporated within RBBSSUB 2-5 as
' separately callable subroutines in order to free up as much
' code as possible within the 64K code segment used by RBBS-PC.BAS.
' Parameters..........: Most parameters are passed via a COMMON statement.
'
' Subroutine Line Function of Subroutine
' Name Number
' BinSearch 63520 Binary searches sorted file for a key value
' BreakFileName 63300 Break file name into component parts
' BufAsUnit 63500 Buffer out a string with CR's
' SetPrompt 63470 Set prompts based on the user's security
' DoorReturn 63100 Process door requests
' FdMacExe 63462 Executes a found macro
' FileSystem 20117 File System for RBBS-PC
' FindIt 63490 Check whether file exists and if so open as #2
' FormRead 63420 Read from file into a form
' LockAppend 63400 Prepare for a file append
' MacroExe 63460 Execute internal macro rather than user
' MsgNameMatch 63540 Match name to one in msg header
' NoPath 63480 Detects whether string has a path in it
' RestoreCom 63310 Restore comm port after external program
' ReadMacro 63330 Read and process macro
' ShellExit 63320 Exit RBBS via shell
' TakeOffHook 63530 Take modem off hook
' UnLockAppend 63410 Clean up after file append
' VerifyAns 63510 Verify that string passes edits
' WildCard 63200 Match string to a pattern
'
' $INCLUDE: 'RBBS-VAR.BAS'
'
* REPLACING old line(s) by new
20119 ZErrCode = 0
GOTO 20122
'
' ***** SCAN DIRECTORIES (PRINT TEXT) ****
'
* ------[ first line different ]------
' (formerly lines 7000 to 7260 in RBBS-PC.BAS CPC16-1A
* REPLACING old line(s) by new
20120 ZOutTxt$ = "Scanning Directory " + _
ZFileNameHold$
IF WasRS$ <> "" THEN _
ZOutTxt$ = ZOutTxt$ + " for " + WasRS$
GOSUB 21650
IF ZFileSysParm > 1 THEN _
RETURN
* ------[ first line different ]------
CALL AskMore ("",ZTrue,ZTrue,ZAnsIndex,ZFalse) ' KG040901
IF ZNo THEN _ ' KG040901
ZErrCode = 0 : _ ' KG040901
RETURN ' KG040901
WasPG = ZTrue
* REPLACING old line(s) by new
20122 CALL OpenWork (2,ZFileName$)
IF ZErrCode = 53 THEN _
ZOutTxt$ = "Missing File " + ZFileName$ : _
CALL UpdtCalr (ZOutTxt$,2) : _
ZOutTxt$ = ZOutTxt$ + _
". Please tell SYSOP" : _
GOSUB 21650 : _
RETURN
ZJumpSupported = ZTrue
ZJumpLast$ = ""
LastOK = ZFalse
* ------[ first line different ]------
ZJumpSearching = ZFalse ' ML071502
* REPLACING old line(s) by new
20159 IF ZAnsIndex < ZLastIndex THEN _
GOTO 20155
ZSearchingAll = ZFalse
CALL CmdStackPushPop (1)
ZLastIndex = 0
IF ZNo OR (ZFileNameHold$ = ZDirPrefix$) THEN _
GOTO 20155
CALL QuickTPut (ZEmphasizeOff$,0)
* ------[ first line different ]------
ZOutTxt$ = "End list. R)elist, [Q]uit, or file(s) to dwnld" ' KG082004
ZStackC = ZTrue
GOSUB 21668
CALL AllCaps (ZUserIn$(1))
IF ZUserIn$(1) = "R" THEN _
ZUserIn$(ZAnsIndex) = WasA1$ : _
GOTO 20161
IF LEN(ZUserIn$(1)) > 1 AND _
ZUserSecLevel >= ZOptSec(19 - 20 * (ZMenuIndex = 6)) THEN _
ZAnsIndex = 1 : _
GOSUB 20202
CALL CmdStackPushPop (2)
RETURN
* REPLACING old line(s) by new
20222 CALL RotorsDir (ZFileName$,ZSubDir$(),ZSubDirCount + _
((ZUserSecLevel < ZMinSecToView) OR _
* ------[ first line different ]------
NOT ZCanDnldFromUp),MarkingTime,"D") ' KG022204
* REPLACING old line(s) by new
20247 ZWasDF = 0
CALL BreakFileName (ZFileName$,DR$,WasX$,Extension$,ZFalse)
IF ZAutoDownInProgress THEN _
* ------[ first line different ]------
ZUserIn$(ZAnsIndex) = WasX$ + "." + Extension$ : _ ' RH022501
ZOutTxt$ = "Transferring -- " + _
ZUserIn$(ZAnsIndex) : _ ' RH022501
GOSUB 21640 : _
IF ZFileSysParm > 1 THEN _
RETURN
IF INSTR("...WRK.FW .ARC.EXE.COM.OBJ.WKS.LBR.ZIP.PAK.ZOO.LZH.","."+Extension$+".") > 2 OR _
MID$(Extension$,2,1) = "Q" OR _
(ZRequireNonASCII AND Extension$ = "BAS") THEN _
ZWasDF = ZTrue
* REPLACING old line(s) by new
20262 IF ZBatchTransfer THEN _
IF ZAnsIndex < LastDnld THEN _
RETURN _
ELSE ZBlocksInFile# = BatchBlocks# : _
ZBytesInFile# = BatchBytes# : _
ZNumDnldBytes! = BatchBytes# : _
IF ZBytesInFile# < 1 THEN _
RETURN _
ELSE GOSUB 20780 : _
IF ZFileSysParm > 1 OR NOT ZOK THEN _
RETURN
IF ZAutoDownInProgress THEN _
CALL SendName : _
IF ZAbort THEN _
DnldCompleted = ZFalse : _
GOSUB 21760 : _
RETURN
* ------[ first line different ]------
GOSUB 20337 ' XX081401
CALL Transfer
* REPLACING old line(s) by new
20263 IF ZPrivateDoor THEN _
ZCmdTransfer$ = ZWasFT$ : _
CALL XferType (2,ZTrue) : _
ZCmdTransfer$ = ""
CALL OpenWork (2,"XFER-" + ZNodeID$ + ".DEF")
IF ZErrCode <> 0 THEN _
GOTO 20267
CALL ReadParms (ZWorkAra$(), ZFailureParm, 1)
IF ZErrCode <> 0 THEN _
GOTO 20267
* ------[ first line different ]------
CLOSE 2 ' KG040902
CALL KillWork ("XFER-" + ZNodeID$ + ".DEF")
* REPLACING old line(s) by new
20330 IF ZAutoDownInProgress THEN _
RETURN
* ------[ first line different ]------
GOSUB 20337 ' KG032801
ZOutTxt$ = ZProtoPrompt$ + _
" " + WasA1$ + _
" of " + _
ZFileNameHold$ + _
" ready. <Ctrl X> aborts"
GOSUB 21650
* REPLACING old line(s) by new
20335 IF ZTransferFunction = 1 THEN _
CALL Talk (8,ZOutTxt$) _
ELSE CALL Talk (9,ZOutTxt$)
RETURN
* ------[ first line different ]------
* INSERTING new line(s)
20337 IF ZProtoMacro$ <> "" THEN _ ' KG032801
ZGSRAra$(1) = MID$("DU ",ZTransferFunction,1) : _ ' KG032801
CALL MacroExe (ZProtoMacro$) ' KG032801
RETURN ' KG032801
'
' * ASCII DOWNLOAD DRIVER
'
* REPLACING old line(s) by new
20340 IF ZWasDF THEN _
ZOutTxt$ = "Switch to a non-ascii protocol" : _
GOSUB 21650 : _
GOTO 21700
GOSUB 20750
IF ZFileSysParm > 1 OR NOT ZOK THEN _
RETURN
CALL OpenWork (2,ZFileName$)
IF (ZAnsIndex = FirstDnld OR NOT ZConcatFIles) THEN _
* ------[ first line different ]------
GOSUB 20337 : _ ' KG032801
ZOutTxt$ = "^X aborts. ^S suspends ^Q resumes" : _
GOSUB 21640 : _
IF ZFileSysParm > 1 THEN _
RETURN _
ELSE ZOutTxt$ = ZProtoPrompt$ + " SEND of " + _
ZFileNameHold$ + _
" ready. Press Any Key to start" : _
ZTurboKey = 2 : _
ZForceKeyboard = ZTrue : _
ZSuspendAutologoff = ZTrue : _
GOSUB 21660 : _
ZSuspendAutologoff = ZFalse : _
GOSUB 20335 : _
IF ZFileSysParm > 1 THEN _
RETURN
* REPLACING old line(s) by new
20430 ZAnsIndex = ZLastIndex
GOSUB 20470
ZLastIndex = ZLastIndex + (WasX > 0)
* ------[ first line different ]------
LastUpld = ZLastIndex ' KG072702
* INSERTING new line(s)
20432 FOR ZAnsIndex = FirstUpld TO LastUpld ' KG072702
GOSUB 20470
GOSUB 20435
FirstUpld = FirstUpld + 1 ' KG072702
IF ZFileSysParm > 1 THEN _
ZAnsIndex = LastUpld + 1 ' KG072702
NEXT
ZCmdTransfer$ = ""
RETURN
* REPLACING old line(s) by new
20435 ZFileNameHold$ = ZUserIn$(ZAnsIndex)
* ------[ first line different ]------
ExtSrch = ZFalse ' ML080601
IF INSTR(ZFileNameHold$,".") = 0 THEN _
ZFileNameHold$ = ZFileNameHold$ + "." + ZDefaultExtension$
CALL AllCaps(ZFileNameHold$)
ZFileName$ = ZFileNameHold$
ZViolation$ = "Upload "
CALL NoPath (ZFileName$,BadFileNameIndex)
IF BadFileNameIndex THEN _
GOTO 20451
CALL BadFile (ZFileName$,BadFileNameIndex)
ON BadFileNameIndex GOTO 20440,20451,20515
* REPLACING old line(s) by new
20440 CALL RotorsDir (ZFileName$,ZSubDir$(),ZSubDirCount,ZTrue,"U") ' KG022204
* REPLACING old line(s) by new
20450 IF Extension$ <> Check$ THEN _
* ------[ first line different ]------
CALL RotorsDir (WasX$ + "." + Check$,ZSubDir$(),ZSubDirCount,ZTrue,"U") : _ ' KG021802
IF ZOK THEN _
ExtSrch = ZTrue : _ ' ML080601
GOTO 20452
GOTO 20447
* REPLACING old line(s) by new
20452 IF ZUserSecLevel < ZOverWriteSecLevel THEN _
GOTO 20453
* ------[ first line different ]------
IF ExtSrch AND (WasX$ + "." + Check$) <> ZFileName$ THEN _ ' ML080601
ZOutTxt$ = WasX$ + "." + Check$ + " already here, " + _ ' ML080601
"upload anyway (Y,[N])" _ ' ML080601
ELSE ZOutTxt$ = "Overwrite file (Y,[N])" ' ML080601
GOSUB 21660
IF ZFileSysParm > 1 THEN _
RETURN
IF NOT ZYes THEN _
GOTO 20453
ZWasZ$ = ZFileName$
CALL KillWork (ZFileName$)
IF ZErrCode <> 0 AND ZErrCode <> 53 THEN _ ' ML080601
ZOutTxt$ = "Unable to overwrite" : _ ' ML080601
GOSUB 21660 : _ ' ML080601
RETURN ' ML080601
GOTO 20475
* REPLACING old line(s) by new
20560 LineACK = (ZDefaultLineACK$ <> "")
IF LineACK THEN _
ZOutTxt$ = "Acknowledge each line ([Y],N)" : _
ZTurboKey = - ZTurboKeyUser : _
LineACK = NOT ZNo : _
GOSUB 21660 : _
IF ZFileSysParm > 1 THEN _
RETURN
* ------[ first line different ]------
GOSUB 20337 ' KG032801
CALL QuickTPut1 ("Transfer MUST end with a <Ctrl-K>")
CALL QuickTPut1 (ZProtoPrompt$+" RECEIVE of " + ZFileNameHold$ + " ready")
ZOK = ZFalse
XOff = ZFalse
CALL OpenOutW(ZFileName$)
IF ZErrCode <> 0 AND ZErrCode <> 53 THEN _
ZWasEL = 20560 : _
GOTO 21900
GOSUB 20510
IF ZFileSysParm > 1 THEN _
RETURN
* REPLACING old line(s) by new
20705 ZMaxMsgLines = ZMaxMsgLinesDef
ZRightMargin = WasLL
* ------[ first line different ]------
GOSUB 20702 ' KG072702
GOTO 20432 ' KG072702
* REPLACING old line(s) by new
20735 CALL KillWork (ZFileName$)
IF ZErrCode <>0 THEN _
ZWasEL = 20736 : _
GOTO 21900
* ------[ first line different ]------
ZAnsIndex = ZLastIndex + 1 ' KG031501
ZLastIndex = 0
RETURN
'
' * Sysop ABORTED UPLOAD
'
* REPLACING old line(s) by new
20745 ZOutTxt$ = ZXOff$ + _
* ------[ first line different ]------
"SYSOP aborted upload. Stop transfer. <Ctrl-K> continues" ' KG081701
GOTO 20675
'
' * CALCULATE DOWNLOAD TIME ESTIMATE
'
* REPLACING old line(s) by new
20760 IF ZErrCode <> 0 THEN _
CALL QuickTPut1 ("Unable to access "+ZFileNameHold$) : _
CALL UpdtCalr ("Unable to access "+ZFileName$,2) : _
ZOK = ZFalse : _
ZErrCode = 0 : _
ZBytesInFile# = 0 : _
RETURN
ZBytesInFile# = LOF(2)
ZNumDnldBytes! = LOF(2)
ZOK = ZTrue
IF SizeOnly THEN _
SizeOnly = ZFalse : _
RETURN
ZBlocksInFile# = MaxBlock
IF ZBatchTransfer THEN _
Temp# = BatchBlocks# + ZBlocksInFile# : _
CALL CheckTimeRemain (MinsRemaining) : _
IF (NOT PersonalDnld) AND _
(INT(Temp# / 60) + 1 > MinsRemaining) THEN _
CALL QuickTPut1 ("Omitting " + ZFileNameHold$ + ". Insufficient time") : _
* ------[ first line different ]------
ZAutoLogoffReq = ZFalse : _ ' KG073001
RETURN _
ELSE BatchBlocks# = Temp# : _
BatchBytes# = BatchBytes# + ZBytesInFile# : _
CALL OpenWorkA (ZNodeWorkFile$) : _
CALL PrintWorkA (ZFileName$) : _
ZDownFiles = ZDownFiles + 1 : _
RETURN
ZDownFiles = 1
* REPLACING old line(s) by new
* ------[ first line different ]------
21810 ZOutTxt$ = "Search string or filename (wildcards OK), [ENTER] quits)" ' DA071701
ZMacroMin = 99
GOSUB 21668
IF ZWasQ = 0 THEN _
RETURN
* REPLACING old line(s) by new
21820 WasRS$ = ZUserIn$(ZAnsIndex)
WildSearch = (INSTR(WasRS$,"*") > 0 OR INSTR(WasRS$,"?") > 0)
CALL AllCaps (WasRS$)
* ------[ first line different ]------
IF RIGHT$(WasRS$,1) = "*" THEN _ ' KG081201
IF RIGHT$(WasRS$,2) <> ".*" THEN _ ' KG081201
WasRS$ = WasRS$ + ".*" ' KG081201
SearchString$ = WasRS$
SearchDate$ = ""
ZJumpSearching = ZFalse
WasA1$ = WasRS$
GOTO 21867
'
' ***** P - personal download ****
'
' (formerly lines 52950 to 52952 in RBBS-PC.BAS
* REPLACING old line(s) by new
21900 IF ZDebug THEN _
ZOutTxt$ = "RBBSSUB5 DEBUG Error Trap Entry ERL=" + _
STR$(ZWasEL) + _
" ERR=" + _
STR$(ZErrCode) : _
IF ZPrinter THEN _
CALL Printit(ZOutTxt$) _
ELSE CALL LPrnt(ZOutTxt$,1)
IF ZWasEL = 20126 AND ZErrCode = 53 THEN _
GOTO 20142
IF ZWasEL = 20242 AND ZErrCode = 62 THEN _
CALL UpdtCalr (ZFileSecFile$ + " bad format!",2) : _
GOTO 20247
IF ZWasEL = 20263 THEN _
ZOutTxt$ = "<Download aborted>" : _
DnldCompleted = ZFalse : _
* ------[ first line different ]------
GOTO 20390 ' ML080601
IF ZWasEL = 20560 AND ZErrCode = 67 THEN _
GOTO 20451
IF ZWasEL = 20560 AND ZErrCode = 70 THEN _
IF VAL(ZFreeSpace$) > 1999 THEN _
GOTO 20610 _
ELSE CALL QuickTPut1 ("No room for uploads. Try tomorrow.") : _
GOTO 21700
IF ZWasEL = 20620 THEN _
GOTO 20670
IF ZWasEL = 20650 THEN _
GOTO 20670
IF ZWasEL = 20736 AND ZErrCode = 53 THEN _
GOTO 21700
IF ZWasEL = 20900 AND ZErrCode = 75 THEN _
GOTO 21230
IF ZWasEL = 20900 AND ZErrCode = 70 THEN _
CALL QuickTPut1 ("No room for uploads. Try tomorrow.") : _
GOTO 21230
IF ZWasEL = 21131 OR ZWasEL = 21220 THEN _
ZErrCode = 0 : _
GOTO 21230
IF ZWasEL = 21480 THEN _
CALL LogError : _
IF ZErrCode = 57 THEN _
CALL QuickTPut1 ("Error reading file. Aborting download") : _
DnldCompleted = ZFalse : _
GOTO 21230
* REPLACING old line(s) by new
63300 ' $SUBTITLE: 'BreakFileName - sub to split file name into components'
' $PAGE
'
' NAME -- BreakFileName
'
' INPUTS -- PARAMETER MEANING
' FileSpec$ FULL NAME OF FILE
' ForJoining True IF WANT PARTS FORMATTED FOR
' FORMING FILE NAMES
' OUTPUTS -- DrvPath$ DRIVE AND PATH
' Prefix$ PREFIX OF FILE NAME
' Extension$ EXTENSION OF FILE NAME
'
' (E.G. "C:\RBBS\ARCE.COM" HAS "C:\RBBS" AS DRIVE AND PATH,
' "ARCE" AS PREFIX OF THE FILE NAME, AND
' "COM" AS THE EXTENSION OF THE FILE NAME.
'
' JOINED FORMAT IS C:\RBBS\,ARCE,.COM
'
' PURPOSE -- To break a file name into its component parts
' of drive/path, prefix, and extension
'
'
* ------[ first line different ]------
SUB BreakFileName (PassedFileSpec$,DrvPath$,Prefix$,Extension$,ForJoining) STATIC ' KG081705
FileSpec$ = PassedFileSpec$ ' KG081705
CALL AllCaps (FileSpec$)
DrvPath$ = ""
Prefix$ = ""
Extension$ = "" ' KG082301
WasL = LEN(FileSpec$)
IF WasL < 1 THEN _
EXIT SUB
CALL FindLast (FileSpec$,"\",WasX,WasY)
IF WasX < 1 THEN _
IF MID$(FileSpec$,2,1) = ":" THEN _
DrvPath$ = LEFT$(FileSpec$,2) : _ ' DA082101
ZWasS = 3 _
ELSE ZWasS = 1 _
ELSE DrvPath$ = LEFT$(FileSpec$,WasX) : _ ' DA082101
ZWasS = WasX + 1 ' DA082101
WasX = INSTR(ZWasS,FileSpec$ + ".",".") ' EC061301
IF WasX < WasL THEN _
Extension$ = MID$(FileSpec$,WasX) ' DA082101
IF ZWasS <= WasL THEN _
IF WasX >= ZWasS THEN _
Prefix$ = MID$(FileSpec$,ZWasS,WasX - ZWasS)
IF ForJoining THEN _ ' DA082101
EXIT SUB
IF WasY > 1 THEN _ ' KG082301
DrvPath$ = LEFT$(DrvPath$, LEN(DrvPath$) - 1) ' DA082101
IF LEN(Extension$) > 0 THEN _
Extension$ = MID$(Extension$, 2) ' DA082101
END SUB
* REPLACING old line(s) by new
63320 ' $SUBTITLE: 'ShellExit - sub to shell out from RBBS'
' $PAGE
'
' NAME -- ShellExit
'
' INPUTS -- ShellTem$ String to invoke shell with
'
' OUTPUTS -- none
'
' PURPOSE -- Delay so that strings can finish printing. Restore comm
' port on return
'
SUB ShellExit (ShellTem$) STATIC
CALL DelayTime (8 + ZBPS)
IF NOT ZLocalUser THEN _
IF ZFossil THEN _
CALL FOSExit(ZComPort) _
ELSE CLOSE 3 : _
OUT ZModemCntlReg,INP(ZModemCntlReg) OR 1
CLOSE 2
CALL MetaGSR (ShellTem$,ZFalse)
SHELL ShellTem$
IF ZFossil THEN _
IF NOT ZLocalUser THEN _
CALL FOSinit(ZComPort,Result) : _
IF Result = -1 THEN _
* ------[ first line different ]------
CALL PScrn("ERROR INIT FOSSIL AFT EXTERNAL") : _ ' KG072701
SYSTEM
CALL DelayTime (2)
CALL RestoreCom
END SUB
* REPLACING old line(s) by new
63330 ' $SUBTITLE: 'ReadMacro - sub to read macro'
' $PAGE
'
' NAME -- ReadMacro
'
' INPUTS -- PARAMETER MEANING
'
' OUTPUTS -- ZOutTxt$ LINE TO PROCESS IN MACRO
' ZMacroActive FLAG WHETHER IN A MACRO
'
' PURPOSE -- Reads in a line from macro file (#6) and processes
' macro commands, which are:
' *0 - display what follows, no carriage return
' *1 - display what follows with carriage return
' *B - display block that follows
' *F - display File
' WT - wait specified # of seconds
' >> - append following block to specified file
' ST - stack following (with carriage return)
' ON - define case
' == - case value that applies to following block
' M! - execute following macro
' M@ - abort macro processing
' EY - Echo on (yes)
' EN - Echo off (no)
' /* - comment line skipped in processing
' TK - Turbo key on (if user preference)
' << - Read from file into a form
' := - Assign value to work variable
* ------[ first line different ]------
' LO - Set the location of a file ' KG022301
'
SUB ReadMacro STATIC
IF ZMacroTemplate$ <> "" THEN _
GOTO 63392
IF ZDistantTGet = 2 THEN _
GOTO 63349
* REPLACING old line(s) by new
63336 GOSUB 63395
IF NOT ZMacroActive THEN _
ZMacroEcho = ZTrue : _
* ------[ first line different ]------
EXIT SUB ' KG042501
IF CompareVar > 0 THEN _
IF NOT CaseExecute THEN _
IF LEFT$(ZOutTxt$,3) = ZSmartTextCode$+"==" THEN _
WasX$ = RIGHT$(ZOutTxt$,LEN(ZOutTxt$)-3) : _ ' KG042501
GOTO 63370 _
ELSE IF LEFT$(ZOutTxt$,7) = ZSmartTextCode$ + "END ON" THEN _
CompareVar = 0 : _
GOTO 63336 _
ELSE GOTO 63336
IF LEN(ZOutTxt$) < 3 THEN _ ' KG042501
GOTO 63398 ' KG042501
WasX$ = RIGHT$(ZOutTxt$,LEN(ZOutTxt$)-3) ' KG042501
IF LEFT$(ZOutTxt$,1) <> ZSmartTextCode$ THEN _
GOTO 63398
CALL CheckInt (MID$(ZOutTxt$,2))
IF ZErrCode > 0 THEN _
GOTO 63398
IF ZTestedIntValue > 0 AND ZTestedIntValue <= ZMaxWorkVar THEN _
ZOutTxt$ = WasX$ : _ ' Macro command ask
ZForceKeyboard = ZTrue : _
ZMacroSave = ZTestedIntValue : _
ZLinesPrinted = 1 : _
ZNonStop = (ZPageLength < 1) : _
EXIT SUB
ON (1+INSTR("*0*1*B*FWT>>STON==M!M@EYEN/*TK<<:=LVNVCVLO",MID$(ZOutTxt$,2,2)))\2 GOTO _ ' KG022301
63345, _ ' Display with no Carriage Return
63347, _ ' Display with Carriage Return
63340, _ ' Display Block
63348, _ ' Display File
63343, _ ' Wait # of seconds
63350, _ ' Append to file
63355, _ ' Stack
63360, _ ' Case
63370, _ ' Case Comparison
63375, _ ' Macro execute
63380, _ ' Macro Abort
63383, _ ' Macro Echo on
63385, _ ' Macro Echo off
63336, _ ' Macro Comment
63387, _ ' Turbo Key allowed
63390, _ ' Form read
63362, _ ' Assign value to work var
63363, _ ' LV list verify
63364, _ ' NV number verify
63364, _ ' CV character verify ' KG022301
63367 ' LO assign file location ' KG022301
GOTO 63398
* REPLACING old line(s) by new
* ------[ first line different ]------
63362 CALL Trim (WasX$) ' KG021803
CALL CheckInt (WasX$)
WasX = INSTR(WasX$," ")
IF WasX > 0 AND ZTestedIntValue > 0 AND ZTestedIntValue <= ZMaxWorkVar THEN _
ZGSRAra$(ZTestedIntValue) = RIGHT$(WasX$,LEN(WasX$)-WasX) ' KG021803
GOTO 63336
* INSERTING new line(s)
63367 CALL TRIM (WasX$) ' KG022301
ZFileLocation$ = WasX$ ' KG022301
GOTO 63336 ' KG022301
* REPLACING old line(s) by new
63522 RecFoundAt = 0
* ------[ first line different ]------
IF High < 1 THEN _ ' KG072102
EXIT SUB ' KG072102
WasX$ = SPACE$ (NumChars)
Done = ZFalse
WHILE NOT Done
WasI = INT(((High + Low) / 2) + .5)
GET 2, WasI
LSET WasX$ = MID$(SearchRec$, StartPos, NumChars)
IF WasX$ = SearchFor$ THEN _
RecFound$ = SearchRec$: _
RecFoundAt = WasI : _
Done = ZTrue _
ELSE IF (High - Low) < 2 THEN _
Done = ZTrue _
ELSE IF WasX$ < SearchFor$ THEN _
Low = WasI _
ELSE IF WasX$ > SearchFor$ THEN _
High = WasI
WEND
END SUB
* REPLACING old line(s) by new
63540 ' Match Name to one in message file
SUB MsgNameMatch (PrimeName$,AltName$,SearchPos,Found) STATIC
WasX$ = LEFT$(PrimeName$+" ",22-8*(SearchPos < 7))
* ------[ first line different ]------
GOSUB 63542 ' KG052201
IF Found OR AltName$ = "" THEN _ ' KG052201
EXIT SUB ' KG052201
WasX$ = LEFT$(AltName$ + " ",22-8*(SearchPos < 7))
GOSUB 63542 ' KG052201
EXIT SUB ' KG052201
* INSERTING new line(s)
63542 WasY$ = MID$(ZMsgRec$,SearchPos,LEN(WasX$)) ' KG052201
ZWasDF = INSTR(WasY$,"@") ' KG052201
IF ZWasDF > 0 THEN _ ' KG052201
MID$(WasY$,ZWasDF) = " " ' KG052201
Found = (WasY$ = WasX$) ' KG052201
RETURN ' KG052201
END SUB